﻿using System;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace Trade.Journal
{
    public class PhotoInfo
    {
        public string Id { get; set; } = Guid.NewGuid().ToString("N");

        public string RecordId { get; set; }

        public string DealId { get; set; }
         
        public BitmapSource Data { get; set; }


        private BitmapSource _Thumbnail;
        public BitmapSource Thumbnail
        {
            get
            {
                if (_Thumbnail == null)
                {
                    if (Data == null) return null;

                    _Thumbnail = new TransformedBitmap(Data, new ScaleTransform(0.4, 0.4));
                }
                return _Thumbnail;
            }
            set
            {
                _Thumbnail = value;
            }
        }

        public BarCycle TargetCycle { get; set; }

    }
}